<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {
    Route::get('/',['as' => 'Home.Page.index', 'uses' => 'HomeController@index']);
    Route::get('indexTwo',['as' => 'Home.Page.indexTwo', 'uses' => 'HomeController@indexTwo']);
    Route::get('login',['as' => 'Home.Page.login', 'uses' => 'HomeController@login']);
    Route::get('login-out',['as' => 'Home.Page.loginOut', 'uses' => 'HomeController@loginOut']);
    Route::get('join-member',['as' => 'Home.Page.joinMember', 'uses' => 'HomeController@joinMember']);
    Route::get('user-center',['as' => 'Home.Page.userCenter', 'uses' => 'HomeController@userCenter']);
    Route::get('page/{tag?}',['as' => 'Home.Page.page', 'uses' => 'HomeController@page']);
    Route::get('forum',['as' => 'Home.Page.forum', 'uses' => 'HomeController@forum']);
    Route::get('change-user-info',['as' => 'Home.Page.changeUserInfo', 'uses' => 'HomeController@changeUserInfo']);
    Route::get('h5Pay',['as' => 'Home.Page.h5Pay', 'uses' => 'HomeController@h5Pay']);
    Route::get('pay-success',['as' => 'Home.Page.paySuccess', 'uses' => 'HomeController@paySuccess']);
    Route::get('ip-test',['as' => 'Home.Page.ipTest', 'uses' => 'HomeController@ipTest']);
    Route::get('forum-index',['as' => 'Home.Page.forumIndex', 'uses' => 'HomeController@forumIndex']);
    Route::get('forum-home',['as' => 'Home.Page.forumHome', 'uses' => 'HomeController@forumHome']);
    Route::get('forum-detail',['as' => 'Home.Page.forumDetail', 'uses' => 'HomeController@forumDetail']);
});

Route::group(['middleware' => ['web'],'prefix'=>'admin'],function(){
    Route::get('login',['as' => 'Admin.Home.login', 'uses' => 'AdminController@login']);
    Route::get('plan-list',['as' => 'Admin.Home.planList', 'uses' => 'AdminController@planList']);
    Route::get('plan-add',['as' => 'Admin.Home.planAdd', 'uses' => 'AdminController@planAdd']);
    Route::get('member-list',['as' => 'Admin.Home.memberList', 'uses' => 'AdminController@memberList']);
    Route::get('select-list',['as' => 'Admin.Home.selectList', 'uses' => 'AdminController@selectList']);
    Route::get('page-list',['as' => 'Admin.Home.pageManager', 'uses' => 'AdminController@pageManager']);
    Route::get('page-set',['as' => 'Admin.Home.pageSet', 'uses' => 'AdminController@pageSet']);
    Route::get('data-show',['as' => 'Admin.Home.dataShow', 'uses' => 'AdminController@dataShow']);
    Route::get('set-share-info',['as' => 'Admin.Home.setShareInfo', 'uses' => 'AdminController@setShareInfo']);
    Route::get('function-list',['as' => 'Admin.Home.functionList', 'uses' => 'AdminController@functionList']);
    Route::get('industry-list',['as' => 'Admin.Home.industryList', 'uses' => 'AdminController@industryList']);
    Route::get('forumList',['as' => 'Admin.Home.forumList', 'uses' => 'AdminController@forumList']);
    Route::get('forumSet',['as' => 'Admin.Home.forumSet', 'uses' => 'AdminController@forumSet']);
    Route::get('forumDiscussList',['as' => 'Admin.Home.forumDiscussList', 'uses' => 'AdminController@forumDiscussList']);
    Route::get('forum-discuss-set',['as' => 'Admin.Home.forumDiscussSet', 'uses' => 'AdminController@forumDiscussSet']);
});

/** 接口路由 */
Route::group(['middleware' => ['web']], function () {
    Route::group(['prefix'=>'api', 'namespace'=>'Api'],function(){
        /** 验证相关接口 */
        Route::group(['prefix' => 'auth'],function(){
            /** 通过手机获取短信验证码接口 */
            Route::post('get-phone-code', ['as' => 'Api.Auth.getVerifyCodeByPhone', 'uses' => 'AuthController@getVerifyCodeByPhone']);
            Route::post('sign-in', ['as' => 'Api.Auth.signIn', 'uses' => 'AuthController@signIn']);
            Route::post('reset-password', ['as' => 'Api.Auth.ResetPassword', 'uses' => 'AuthController@ResetPassword']);
            Route::get('login-out', ['as' => 'Api.Auth.loginOut', 'uses' => 'AuthController@loginOut']);
            Route::get('weibo-login', ['as' => 'Api.Auth.weiboLogin', 'uses' => 'AuthController@weiboLogin']);
            Route::get('weibo-callback', ['as' => 'Api.Auth.weiboCallback', 'uses' => 'AuthController@weiboCallback']);
            Route::get('captcha', ['as' => 'Api.Auth.captcha', 'uses' => 'AuthController@captcha']);
        });


         Route::group(['prefix' => 'data'],function(){
             Route::get('getInfos', ['as' => 'Api.Data.captcha', 'uses' => 'DataController@getInfos']);
         });

        /** 图片上传和显示接口 2017.12.19 */
        Route::group(['prefix' => 'file'],function(){
            /** 输出原图片接口 2017.12.19 */
            Route::get('photo-show/{id}',['as'=>'Api.Image.showPhotoByUserid','uses'=>'ImageController@showPhotoByUserid']);
            Route::get('image-show/{id}',['as'=>'Api.Image.Show','uses'=>'ImageController@getImageUrlById']);
            /** 输出不同尺寸图片接口 2017.12.19 */
            Route::get('image-show/{id}/size/{px}',['as'=>'Api.Image.ShowPX','uses'=>'ImageController@getImageBinAsShowById']);
            /** 剪裁图片接口 2017.12.19 */
            Route::post('crop-image',['as'=>'Api.Image.CropImage','uses'=>'ImageController@CropImage']);
            /** 上传图片接口 2017.12.19 */
            Route::post('upload-image',['as'=>'Api.Upload.Image','uses'=>'ImageController@upload']);
            Route::post('upload-video-image',['as'=>'Api.Upload.uploadVideoImg','uses'=>'ImageController@uploadVideoImg']);
            Route::post('uploadVideo',['as'=>'Api.Upload.uploadVideo','uses'=>'ImageController@uploadVideo']);
        });


        Route::group(['prefix' => 'wechat'],function(){
            Route::any('index',['as'=>'Api.Wechat.index','uses'=>'WechatController@index']);
            Route::get('login',['as'=>'Api.Wechat.wechatLogin','uses'=>'AuthController@wechatLogin']);
            Route::get('callback',['as'=>'Api.Wechat.wechatCallback','uses'=>'AuthController@wechatCallback']);
            Route::post('get-js-api-packet',['as'=>'Api.Wechat.getJsApiPacket','uses'=>'WechatController@getJsApiPacket']);
        });

        Route::group(['prefix' => 'user'],function(){
            Route::get('get-pro',['as'=>'Api.User.getPro','uses'=>'UserController@getPro']);
            Route::get('get-indus',['as'=>'Api.User.getIndus','uses'=>'UserController@getIndus']);
            Route::get('get-child-pro',['as'=>'Api.User.getChildPro','uses'=>'UserController@getChildPro']);
            Route::get('get-child-indus',['as'=>'Api.User.getChildIndus','uses'=>'UserController@getChildIndus']);
            Route::post('change-userinfo',['as'=>'Api.User.changeUserInfo','uses'=>'UserController@changeUserInfo']);
        });

        Route::group(['prefix' => 'plan'],function(){
            Route::post('join',['as'=>'Api.Plan.joinPlan','uses'=>'PlanController@joinPlan']);
            Route::post('startJoin',['as'=>'Api.Plan.startJoin','uses'=>'PlanController@startJoin']);
        });

        Route::group(['prefix' => 'payment'],function(){
            Route::any('wechat-pay-callback',['as'=>'Api.Payment.wechatPayCallBack','uses'=>'PaymentController@wechatPayCallBack']);
            Route::post('payByWechatJsApi',['as'=>'Api.Payment.payByWechatJsApi','uses'=>'PaymentController@payByWechatJsApi']);
            Route::post('payByWechatH5',['as'=>'Api.Payment.payByWechatH5','uses'=>'PaymentController@payByWechatH5']);
        });

        Route::group(['prefix' => 'forum'],function(){
            Route::post('setUserContent',['as'=>'Api.Forum.setUserContent','uses'=>'ForumController@setUserContent']);
        });
    });

    Route::group(['prefix' => 'api/admin','namespace'=>'Api\Admin'],function(){
        Route::post('auth/sign-in',['as'=>'Api.Admin.Auth.signInAdmin','uses'=>'AuthController@signInAdmin']);
        Route::post('plan/set-plan',['as'=>'Api.Admin.Plan.setPlan','uses'=>'PlanController@setPlan']);
        Route::post('plan/start-plan',['as'=>'Api.Admin.Plan.startPlan','uses'=>'PlanController@startPlan']);
        Route::post('plan/delete',['as' => 'Api.Admin.Plan.delPlan', 'uses' => 'PlanController@delPlan']);
        Route::post('plan/setContact',['as' => 'Api.Admin.Plan.setContact', 'uses' => 'PlanController@setContact']);
        Route::post('plan/setSelect',['as' => 'Api.Admin.Plan.setSelect', 'uses' => 'PlanController@setSelect']);
        Route::post('plan/setClose',['as' => 'Api.Admin.Plan.setClose', 'uses' => 'PlanController@setClose']);
        Route::post('plan/setShareInfo',['as' => 'Api.Admin.Plan.setShareInfo', 'uses' => 'PlanController@setShareInfo']);
        Route::post('page/setPage',['as' => 'Api.Admin.Page.setPage', 'uses' => 'PageController@setPage']);
        Route::post('data/getNewData',['as' => 'Api.Admin.Page.getNewData', 'uses' => 'DataController@getNewData']);
        Route::post('plan/setPlanNum',['as' => 'Api.Admin.Page.setPlanNum', 'uses' => 'PlanController@setPlanNum']);
        Route::get('plan/planSetAction',['as' => 'Api.Admin.Page.planSetAction', 'uses' => 'PlanController@planSetAction']);
        Route::post('sys/setProfession',['as' => 'Api.Admin.Sys.setProfession', 'uses' => 'SystemController@setProfession']);
        Route::post('sys/setIndustry',['as' => 'Api.Admin.Sys.setIndustry', 'uses' => 'SystemController@setIndustry']);
        Route::post('sys/delProfession',['as' => 'Api.Admin.Sys.delProfession', 'uses' => 'SystemController@delProfession']);
        Route::post('sys/delIndustry',['as' => 'Api.Admin.Sys.delIndustry', 'uses' => 'SystemController@delIndustry']);
        Route::post('forum/setForum',['as' => 'Api.Admin.Forum.setForum', 'uses' => 'ForumController@setForum']);
        Route::post('forum/delForum',['as' => 'Api.Admin.Forum.delForum', 'uses' => 'ForumController@delForum']);
        Route::post('forum/delForumDiscuss',['as' => 'Api.Admin.Forum.delForumDiscuss', 'uses' => 'ForumController@delForumDiscuss']);
        Route::post('forum/setForumDiscuss',['as' => 'Api.Admin.Forum.setForumDiscuss', 'uses' => 'ForumController@setForumDiscuss']);
    });
});
